<?php

namespace app\api\controller;

use think\facade\Db;

/**
 * 默认控制器
 * Class Index
 * @package app\api\controller
 */
class Dining extends Controller {
	public function getPoiInfo() {

		$shops = Db::name('store_shop')->select()->toArray();
		foreach ($shops as &$shop) {
			$shop['business_time'] = $shop['start_time'] . '-' . $shop['end_time'];
			$shop['biz_type'] = 1;
			$shop['coordinate_src'] = 1;
			$shop['x'] = $shop['longitude'];
			$shop['y'] = $shop['latitude'];
			$shop['star'] = '5.0';
			$shop['box_flag'] =1;
			$shop['parking_flag'] =1;
			$shop['nosmoking_flag'] =0;
			$shop['wifi_flag'] =1;
			$shop['other_service'] ='';
			$shop['menu_info'] =$menu_info;
			$shop['shop_tel'] =$shop['phone'];
			$shop['cover_info'] =[];
			$shop['pic_info'] =[];
			$shop['price'] =$shop['money'];
			$shop['tags'] =$shop['tags'];
			$shop['ext'] ='';
			$shop['review'] =[];
			$shop['review_label'] =[];
			$shop['label_impress'] =[];
			$shop['star_list'] =[];
			$shop['app_service'] =[];
			$shop['reserve_info'] =['reserve_notice'=>'订座须知','answerable_starttime'=>$shop['start_time'],'answerable_endtime'=>$shop['end_time'],'contact_tel'=>$shop['phone']];

		}

		//$shop = array_column($shop, 'shop_id');

		$response = ['response' => ['code' => 10000, 'msg' => 'success', 'data' => $shops]];

		return json($response);

	}

	public function getPoiList() {

		$shop = Db::name('store_shop')->field('shop_id')->select()->toArray();
		$shop = array_column($shop, 'shop_id');

		$response = ['response' => ['code' => 10000, 'msg' => 'success', 'data' => ['shop_ids' => $shop]]];

		return json($response);

	}

}